/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace DaveSexton.DocProject.Sandcastle.TopicManagement
{
	internal struct TopicData : IEquatable<TopicData>
	{
		#region Public Properties
		public static readonly TopicData Empty = new TopicData();

		public string TocTitle
		{
			get
			{
				return tocTitle;
			}
		}

		public bool? Expose
		{
			get
			{
				return expose;
			}
		}
		#endregion

		#region Private / Protected
		private readonly string tocTitle;
		private readonly bool? expose;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="TopicData" /> structure.
		/// </summary>
		public TopicData(bool? expose, string tocTitle)
		{
			this.expose = expose;
			this.tocTitle = tocTitle;
		}
		#endregion

		#region Methods
		public override bool Equals(object obj)
		{
			return obj is TopicData && Equals((TopicData) obj);
		}

		public bool Equals(TopicData other)
		{
			return string.Equals(tocTitle, other.tocTitle, StringComparison.Ordinal);
		}

		public override int GetHashCode()
		{
			return (tocTitle == null) ? 0 : tocTitle.GetHashCode();
		}
		#endregion

		#region Operator Overloads
		public static bool operator ==(TopicData v1, TopicData v2)
		{
			return v1.Equals(v2);
		}

		public static bool operator !=(TopicData v1, TopicData v2)
		{
			return !v1.Equals(v2);
		}
		#endregion
	}
}
